﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title> split()方法的应用示例</title>
</head>
<body>
    <p id="demo">单击按钮显示分割后的数组</p>
    <button onclick="myFunction()">显示</button>
    <script>
        function myFunction() {
            let str = "How are you doing today?";
            let n = str.split(" ", 3);
            document.getElementById("demo").innerHTML = n;
        }
    </script>
</body>
</html>
